﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace GuiSearcher.Enums {
    public class MySqlKeywordsEnumWrapper {

        public enum MySqlKeywordsEnum {
            AND,
            OR
        }

        public static Dictionary<MySqlKeywordsEnum, string> StringSearchKeywords {
            get {
                return new Dictionary<MySqlKeywordsEnum, string>() {
                    {MySqlKeywordsEnum.AND, "AND"},
                    {MySqlKeywordsEnum.OR, "OR"}
                };
            }
        }

        public static List<string> GetStringList() {
            return MySqlKeywordsEnumWrapper.StringSearchKeywords.Select(skw => skw.Value).ToList(); 
        }

        public static string[] GetStringArray() {
            return MySqlKeywordsEnumWrapper.StringSearchKeywords.Select(skw => skw.Value).ToArray();
        }

        public static List<MySqlKeywordsEnum> GetEnumList() {
            return MySqlKeywordsEnumWrapper.StringSearchKeywords.Select(skw => skw.Key).ToList();
        }

        public static string GetStringByEnum(MySqlKeywordsEnum enumValue) {
            return StringSearchKeywords[enumValue];
        }

        public static string GetEnumByString(string enumString) {
            return StringSearchKeywords.Values.FirstOrDefault(v => v == enumString);
        }

    }
}
